import axios from '@/libs/api.request'

// 用户列表
export const getUserList = (params) => {
  return axios.request({
    url: '/api/Users',
    params: params,
    method: 'get'
  })
}

// 删除用户
export const deleteUser = (id) => {
  return axios.request({
    url: '/api/Users/' + id,
    // params: params,
    method: 'delete'
  })
}

// 新增用户
export const addUserInfo = (params) => {
  return axios.request({
    url: '/api/Users/Insert',
    params: params,
    method: 'post'
  })
}

// 部门列表
export const getDepartment = () => {
  return axios.request({
    url: '/api/Department',
    params: {},
    method: 'get'
  })
}

// 职务列表
export const getDuty = () => {
  return axios.request({
    url: '/api/Duty',
    params: {},
    method: 'get'
  })
}

// 用户详情信息
export const getUserInfo = (id) => {
  return axios.request({
    url: '/api/Users/' + id,
    params: {},
    method: 'get'
  })
}

// 用户配置角色
export const postUserRole = (params) => {
  return axios.request({
    url: '/api/Roles/user',
    params: params,
    method: 'post'
  })
}

// 删除用户配置角色
export const deleteUserRole = (params) => {
  return axios.request({
    url: '/api/Roles/deleteUser',
    params: params,
    method: 'delete'
  })
}

// 角色列表下拉
export const getRoleList = (params) => {
  return axios.request({
    url: '/api/Roles',
    params: params,
    method: 'get'
  })
}

// 总数
export const getNumberList = (params) => {
  return axios.request({
    url: '/api/Statistics',
    params: params,
    method: 'get'
  })
}

// 用户列表搜索
export const getUserSearchList = (params) => {
  return axios.request({
    url: '/api/Users/quckSearchPage',
    params: params,
    method: 'get'
  })
}

// 用户
export const postUserState = (params) => {
  return axios.request({
    url: '/api/users/UserState',
    params: params,
    method: 'post'
  })
}

// 新增用户
export const editUserInfo = (params) => {
  return axios.request({
    url: '/api/Users/Update',
    data: params,
    method: 'post'
  })
}

// 获取手机号
export const forgetPWD = (params) => {
  return axios.request({
    url: '/api/Users/forgetPWD',
    params: params,
    method: 'GET'
  })
}

// 发送验证码
export const sendMSG = (params) => {
  return axios.request({
    url: '/api/Users/sendMSG',
    params: params,
    method: 'GET'
  })
}

// 修改密码
export const changeUserPWD = (params) => {
  return axios.request({
    url: '/api/Users/changeUserPWD',
    data: params,
    method: 'post'
  })
}
